package com.cg.big_event.entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDate;
import java.io.Serializable;
/**
 * 用户表(User)实体类
 *
 * @author 李浩月
 * @since 2024-11-19 22:39:33
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    /**
     * ID
     */
    @NotNull
    private String id;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    //返回结果为json时忽略掉password
    @JsonIgnore
    private String password;
    /**
     * 昵称
     */
    @NotEmpty
    @Pattern (regexp = "^\\S{1,10}$")
    private String nickname;
    /**
     * 邮箱
     */
    @NotEmpty
    @Email
    private String email;
    /**
     * 头像
     */
    private String userPic;
    /**
     * 创建时间
     */
    private LocalDate createTime;
    /**
     * 修改时间
     */
    private LocalDate updateTime;
}

